package team.future.joke.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import team.future.joke.constant.BaseConstants;
import team.future.joke.param.JokeParam;
import team.future.joke.service.JokeService;

/**
 * Title: MobileController.java<br>
 * Description: <br>
 * Copyright (c) 未来工作室版权所有 2015    <br>
 * Create DateTime: 2015年9月23日 下午8:40:49 <br>
 * @author futurezhu
*/
@Controller
public class MobileController {

	@Autowired
	private JokeService jokeService;

	/**
	 * 需要传入uid pageSize
	 * @param model
	 * @param param
	 * @return
	 */
	@RequestMapping("/joke/mobile/index")
	public String jokeIndex(ModelMap model, @ModelAttribute("JokeParam") JokeParam param) {
		/*param.setPageSize(5);
		param.setPageType("new");
		List<Joke> jokelist = jokeService.getJokeListPage(param);
		model.put("jokes", jokelist);*/
		model.put("pageType", param.getPageType());
		model.put("uid", param.getUid());
		model.put("ip", param.getIp());
		model.put("phoneType", param.getPhoneType());
		model.put("urlPre", BaseConstants.REAL_URL);
		return "/mobile/index";
	}
}
